package com.oneinlet.component.activemq;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * Created by WangZiHe on 2018/6/10
 * QQ/WeChat:648830605
 * QQ-Group:368512253
 * Blog:www.520code.net
 * Github:https://github.com/yancheng199287
 */
@Component
public class Consumer {

    /**
     * 消息队列监听器
     * destination 队列地址
     * containerFactory 监听器容器工厂, 若存在2个以上的监听容器工厂,需进行指定 jmsListenerContainerQueue  jmsListenerContainerTopic
     */
    @JmsListener(destination = "520code.net", containerFactory = "jmsListenerContainerTopic")
    public void receive(String msg) {

        System.out.println("点对点模式,消费消息: " + msg);

    }
}
